package cn.pet_know.controller;

import cn.pet_know.common.result.R;
import cn.pet_know.entity.dto.PetCircleDTO;
import cn.pet_know.entity.vo.PetCircleVO;
import cn.pet_know.service.PetCircleService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/petCircle")
public class PetCircleController {

    @Resource
    private PetCircleService petCircleService;

    @PostMapping("/toAdd")
    public R<Boolean> toAdd(@RequestBody PetCircleDTO petCircleDTO) {
        return R.ok(petCircleService.toAdd(petCircleDTO));
    }
    @PostMapping("/toDel")
    public R<Boolean> toDel(@RequestBody PetCircleDTO petCircleDTO) {
        return R.ok(petCircleService.toDel(petCircleDTO));
    }
    @PostMapping("/toUp")
    public R<Boolean> toUp(@RequestBody PetCircleDTO petCircleDTO) {
        return R.ok(petCircleService.toUp(petCircleDTO));
    }
    @PostMapping("/toReview")
    public R<Boolean> toReview(@RequestBody PetCircleDTO petCircleDTO) {
        return R.ok(petCircleService.toReview(petCircleDTO));
    }
    @PostMapping("/toPage")
    public R<IPage<PetCircleVO>> toPage(@RequestBody PetCircleDTO petCircleDTO) {
        return R.ok(petCircleService.toPage(petCircleDTO));
    }

}